USE [HelpUs]
GO

IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_problemapremio]') AND parent_object_id = OBJECT_ID(N'[dbo].[premioSets]'))
ALTER TABLE [dbo].[premioSets] DROP CONSTRAINT [FK_problemapremio]
GO

USE [HelpUs]
GO

/****** Object:  Table [dbo].[premioSets]    Script Date: 05/21/2012 22:45:51 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[premioSets]') AND type in (N'U'))
DROP TABLE [dbo].[premioSets]
GO

USE [HelpUs]
GO

/****** Object:  Table [dbo].[premioSets]    Script Date: 05/21/2012 22:45:51 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[premioSets](
	[idPremio] [int] IDENTITY(1,1) NOT NULL,
	[vlPremio] [float] NOT NULL,
	[tpPremio] [nvarchar](4) NULL,
	[problema_idProblema] [int] NOT NULL,
 CONSTRAINT [PK_premioSets] PRIMARY KEY CLUSTERED 
(
	[idPremio] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[premioSets]  WITH CHECK ADD  CONSTRAINT [FK_problemapremio] FOREIGN KEY([problema_idProblema])
REFERENCES [dbo].[premioSet_problemas] ([idProblema])
GO

ALTER TABLE [dbo].[premioSets] CHECK CONSTRAINT [FK_problemapremio]
GO


